# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ysblokje <ysblokje@gmail.com>
# Contributor: Mark Wagie <mark.wagie@tutanota.com>

pkgname=gamemode
pkgver=1.7
pkgrel=1
pkgdesc='A daemon/lib combo that allows games to request a set of optimisations be temporarily applied to the host OS'
arch=(loong64 x86_64)
url=https://github.com/FeralInteractive/gamemode
license=(BSD)
depends=(
  glibc
  libdbus-1.so
  libinih
  libsystemd.so
  polkit
)
makedepends=(
  git
  meson
)
checkdepends=(appstream)
provides=(
  libgamemode.so
  libgamemodeauto.so
)
_tag=4dc99dff76218718763a6b07fc1900fa6d1dafd9
source=(git+https://github.com/FeralInteractive/gamemode.git#tag=${_tag})
b2sums=(SKIP)

pkgver() {
  cd gamemode
  git describe --tags
}

build() {
  export CFLAGS+=' -Wno-implicit-function-declaration'
  arch-meson gamemode build \
    --libexecdir /usr/lib/gamemode \
    -Dwith-examples=false \
    -Dwith-pam-group=gamemode \
    -Dwith-systemd-user-unit-dir=/usr/lib/systemd/user
  meson compile -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="${pkgdir}" meson install -C build
  install -Dm 644 gamemode/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/gamemode/
}

# vim: set ts=4 sw=4 tw=0 et :
